1. Technical Field
The present invention relates to particle systems, and more particularly, to a particle system architecture for use in creating physical simulations.
2. Discussion of the Related Art
Particle systems are used for a variety of purposes in computer applications. Common uses include generating special effects in video games and movies, and simulating physical processes. Though the calculations behind particle systems are common and well understood, programming libraries to produce a particle system are less common. Most often, simulation programmers create the particle system code for a new application by themselves.
To be useful, a particle system library needs to have links to other systems within the application. As a result, particle system libraries found in game engines include links to features such as graphics, collision detection, and game behaviors, for example. In other applications, such as physical simulation, particle systems are used but are not customizable. For example, a robot painting simulation may use particles to simulate paint covering a surface, however, the user does not have access to the underlying technology or the ability to change the particle system's effects.
In most cases, a particle system is created manually by writing custom code in a programming language like C++, for example. The particle system is generally used for a specific application and is not applicable to any other. For example, a smoke simulation can be implemented using a particle system. To do this, the simulation programmer first determines an algorithm for simulating smoke using a particular particle based model. Then, the programmer writes code that encapsulates the equations of the model and applies it to an array-like data structure that represents the particles' state. All programming aspects are the programmer's responsibility including allocating the memory, keeping track of the particles' state, writing the algorithms for evolving the particles' state over time, and determining what happens when the particles reach other objects in the simulation. There is no module or library structure to the code and any code reuse results from copying and pasting snippets from another source.
Game engines sometimes include a particle system library, but these are highly variable. A sophisticated game engine may have a customizable particle system library with several modules. However, these particle systems are designed for producing graphical effects and do not have a means for producing simulated physical effects as would be desired in a simulation. For example, a particle system in a game engine might have many display parameters that control how each particle changes color over time and what graphical images to use to display the particles.
Some custom simulation systems, such as a robot painting may include a particle system as their means of implementation. However, these kinds of particle systems are hardwired into the system and not accessible to a programmer. Their purpose is to perform a specific simulated activity within the context of the application. The amount of customization that the user has over the particle system depends on the specific application.
Having to write a particle system using custom programming can be difficult and prone to errors. For example, since one is writing the system from scratch and time is limited, it is difficult to add new features or to make the simulations more sophisticated. As a result, hand-written particle systems tend to provide only as many functions as are absolutely needed and may leave out useful features.
Particle systems in game engines vary greatly in sophistication. Some are simple Newtonian solvers that allow a particle to follow arc-like trajectories. These are not always useful in a physical simulation. Further, since even the better particle system libraries in game engines are directed to creating special effects, the programmer has few options to control the effects of the particles on other objects in the system. The particles are there to look good and provide many display and animation features. In a physical simulation, however, having the particle effect other objects, such as painting a surface, moving a turbine or transferring a liquid, is often more important.
The particle systems in custom applications can be useful for their intended purpose, but are not a customizable programming system. For example, since a programmer does not have access to the application's implementation, there is no way to modify the particle simulation to have it do anything else.